const express = require('express');
const router = express.Router();
const shareController = require('../controllers/shareController');
const { authMiddleware } = require('../middleware/auth');

// 需要登录的路由
router.post('/', authMiddleware, shareController.createShare);
router.get('/list', authMiddleware, shareController.getUserShares);
router.delete('/:id', authMiddleware, shareController.cancelShare);

// 无需登录的公开路由
router.get('/:code', shareController.getShareInfo);
router.post('/:code/verify', shareController.verifyPassword);
router.get('/:code/download', shareController.downloadShare);

module.exports = router;

